﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Schema;

namespace Usage
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console用法
            //three components property,event and method
            Console.BackgroundColor = ConsoleColor.Red;
            Console.WriteLine("Please input the first number:");//Writeline会换行，Write不换行是接着写
            double Number1 = double.Parse(Console.ReadLine());//字符串转入数值
            Console.WriteLine("Please input the second number:");
            double Number2 = double.Parse(Console.ReadLine());
            Console.WriteLine($"{Number1}+{Number2}={Number2 + Number1}");
            Console.WriteLine($"{Number1}-{Number2}={Number1 - Number2}");
            Console.WriteLine($"{Number1}*{Number2}={Number1 * Number2}");
            Console.WriteLine($"{Number1}/{Number2}={Number2 / Number1}");
            Console.WriteLine("Please input the third number:");
            int Number3 = Convert.ToInt32(Console.ReadLine());//将字符串转化成数字
            Console.WriteLine(Number2 + "+" + Number1 + "+" + Number3 + "=" + (Number1 + Number2 + Number3));//注意使用括号，+表示字符串拼接的作用
            //Console.WriteLine("{0}+{1}={2},{0},{0},{1}");
            Console.WriteLine("{0}+{1}={2}", Number1, Number2, Number2 + Number1);
            //Console.WriteLine("{0}+{1}={2},{0},{0},{1}", Number1, Number2, Number2 + Number1);
            //Console.WriteLine($"{Number1}+{Number2}={Number2 + Number1}");
            //类型转换分为隐形和显形，把取值范围小的转化为取值范围大的，比如I+D把1+2.0整数变为double,1.0+2.0
            //Convert.toInt32(32位的整数）（64位的整数为long）

            //逻辑用法
            //bool 
            //bool isMale = true;
            //bool isPM = false;
            //if (isMale == isPM)//这两个相等逻辑相等（=赋值）
            //if (isMale ！= isPM)这两个相等逻辑不等
            //if (isMale ！=（！isPM)）取反，后面先非，然后让不等于后面
            //if (isMale & isPM)与，两真才真
            //if (isMale | isPM)或
            //if (isMale ^ isPM)异或
            //if (isMale && isPM) 先算第一个，只有其为真的时候，才算第二个（推荐一定打两个）（&&优先级在||前面，用括号就好）
            //if (isMale || isPM) 先算第一个，如果为真，第二个就不算了
            //布尔赋值运算法不要用
            //位操作符（用不上）
            //控制语句
            //int i = 3;
            //int j = 0;
            ////if (i > j) Console.WriteLine(i);
            ////else Console.WriteLine(j);
            //if (i > j)
            //{
            //    Console.WriteLine(i);
            //}
            //else Console.WriteLine(j);

            //switch (i)
            //{
              
            //}
            for (int i = 0; i < 10; i++)//直接按两下tab
            {
                Console.WriteLine(i);//给i+1
            }
             //do至少走一遍
            do
            {
                break;//跳出循环
                continue;//不再执行直接跳到循环条件判断

            } while (true);
            //foreach (var item in collection)数组
            //{

            //}

            
            Console.ReadKey();
        }
           

        
    }
}
